Skip to content
This repository was archived by the owner on Feb 22, 2026. It is now read-only.

fix: examples for tokio - #127

Merged
obmarg merged 1 commit into
obmarg:mainfrom
jpopesculian:fix-examples
Feb 22, 2026
Merged

fix: examples for tokio#127
obmarg merged 1 commit into
obmarg:mainfrom
jpopesculian:fix-examples

Conversation

@jpopesculian

Copy link
Copy Markdown
Contributor

Examples wouldn't compile because of

  • Not having the required features
  • futures version being outdated

In addition, I added an example for tokio-tungstenite and renamed some examples for clarity and typos

@obmarg

obmarg commented Jun 19, 2025

Copy link
Copy Markdown
Owner

What compile errors were you seeing without these changes?

I build & test the examples on CI so it's a little worrying if that's not working...

@jpopesculian

Copy link
Copy Markdown
Contributor Author

Locally on main, if I run

cargo run --example tokio

the trait bound `StreamingOperation<BooksChangedSubscription>: GraphqlOperation` is not satisfied
  --> examples/examples/tokio.rs:60:39

cargo run --example cynic-mulitiple-subscriptions

error[E0277]: the trait bound `StreamingOperation<BooksChangedSubscription>: GraphqlOperation` is not satisfied
  --> examples/examples/cynic-mulitiple-subscriptions.rs:63:51

cargo run --example graphql-client-single-subscription

error[E0432]: unresolved import `graphql_ws_client::graphql::StreamingOperation`
  --> examples/examples/graphql-client-single-subscription.rs:8:5

cargo run --example cynic-single-subscription

error[E0277]: the trait bound `StreamingOperation<BooksChangedSubscription>: GraphqlOperation` is not satisfied
   --> examples/examples/cynic-single-subscription.rs:56:20

Adding features client-cynic and client-graphql-client fixes those errors. I was also encountering an issue with the futures crate for some reason sticking to futures 0.3.28 when I added tokio-tungstenite so I pinned it to at least 0.3.31 (the other versions are yanked)

@obmarg

obmarg commented Feb 22, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR @jpopesculian and sorry for leaving it sitting around o long. - I got distracted by looking into why CI wasn't catching this and then forgot all about it. My bad.

Have rebased on main and will try to get this in today.

@obmarg
obmarg enabled auto-merge (squash) February 22, 2026 13:18
@obmarg
obmarg merged commit e0f4972 into obmarg:main Feb 22, 2026
2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants